﻿using ESRI.ArcGIS.Client;
using ESRI.ArcGIS.Client.Symbols;
using QDP.Platform.Services;
using QDP.Platform.Silverlight;
using Services.Maps;

namespace Apps.Maps
{
    public class MapToolsBase : PartElement
    {
        public MapToolsBase()
        {
            mapService = ServiceLoader.Load<IMapService>();
            if (mapService != null)
                ActiveMap = mapService.CurrentMap;
        }
        //地图的画笔吗，用于在地图上作图，在拉框放大缩小中使用
        protected Draw drawTool_mainMap
        {
            get
            {
                mapService.DrawTool.DrawMode = DrawMode.Rectangle;
                mapService.DrawTool.FillSymbol = new SimpleFillSymbol()
                    {
                        BorderBrush = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Colors.Green),
                        BorderThickness = 2,
                        Fill = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Colors.Gray) { Opacity = 0.5 }
                    };
                return mapService.DrawTool;
            }
        }
        protected IMapService mapService { get; private set; }
        protected Map ActiveMap { get; private set; }

    }
}